package applets_and_multimedia;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.TitledBorder;

public class LoanAppletApp extends JApplet {
	// Same code in Listing 16.1 from line 7 to line 78

	
	public static void main(String[] args) {
		// Create a frame
		JFrame frame = new JFrame("Applet is in the frame");

		// Create an instance of the applet
		LoanApplet applet = new LoanApplet();
		
		// Add the applet to the frame
		frame.add(applet, BorderLayout.CENTER);
		
		// Invoke applet's init method
		applet.init();
		
		// Display the frame
		frame.setLocationRelativeTo(null); // Center the frame
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(300, 300);
		frame.setVisible(true);
	}
}





